package progress.exa27_5;

import java.util.TreeSet;

public class TreeSetStudy {

    public static void main(String[] args) {

        TreeSet<Integer> set = new TreeSet<>();
        long start = System.currentTimeMillis();
        for(int i=100;i>0;i--){
            set.add(i);
        }
        System.out.println("存储耗时： "+(System.currentTimeMillis()-start)+" ms");
        long start2 = System.currentTimeMillis();
        for(int i=0;i<100;i++){
            boolean c = set.contains(i);
        }
        System.out.println("查询耗时： "+(System.currentTimeMillis()-start2)+" ms");

        for(Integer i:set){
            System.out.print(i+" ");
        }

    }

}
